]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/network: Keep sensitive when locked
authorFlorian Müllner <fmuellner@gnome.org>
Sun, 7 Aug 2022 00:10:22 +0000 (02:10 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 10 Aug 2022 16:37:15 +0000 (16:37 +0000)
Unlike the old menu that restricted almost everything on the lock
screen, we went into the completely opposite direction with quick
settings and kept everything that does not launch windows available.

Extend that line to the network items, but still respect the
`network-control` permission.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2408>

js/ui/status/network.js

index 14df7978bce8f1f2779ef73ee01de01d345f311c..5a351789e63930d04e05022c0f2370229476e1f7 100644 (file)
@@ -1890,20 +1890,16 @@ class Indicator extends PanelMenu.SystemIndicator {
         try {
             this._configPermission = await Polkit.Permission.new(
                 'org.freedesktop.NetworkManager.network-control', null, null);
+
+            this._allSections.forEach(section => {
+                this._configPermission.bind_property('allowed',
+                    section, 'reactive',
+                    GObject.BindingFlags.SYNC_CREATE);
+            });
         } catch (e) {
             log(`No permission to control network connections: ${e}`);
             this._configPermission = null;
         }
-
-        Main.sessionMode.connect('updated', this._sessionUpdated.bind(this));
-        this._sessionUpdated();
-    }
-
-    _sessionUpdated() {
-        const sensitive =
-            !Main.sessionMode.isLocked &&
-            this._configPermission && this._configPermission.allowed;
-        this.menu.setSensitive(sensitive);
     }
 
     _onActivationFailed() {